<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org"
      layout:decorate="~{system/base/layout}">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>后台管理系统-智慧党建-党务管理</title>
    <!-- 引入bootstrap样式 -->
    <link th:href="@{/bootstrap/css/bootstrap.css}" rel="stylesheet" type="text/css">
    <!--图标库-->
    <link th:href="@{/lyear/css/materialdesignicons.min.css}" rel="stylesheet" type="text/css"/>
    <!--    <link th:href="@{/lyear/css/font/iconfont.css}" rel="stylesheet" type="text/css"/>-->
    <link th:href="@{/lyear/css/font2/iconfont.css}" rel="stylesheet" type="text/css"/>
    <!--弹出框样式-->
    <link th:href="@{/lyear/jconfirm/jquery-confirm.min.css}" rel="stylesheet" type="text/css"/>
    <!--自定义样式-->
    <link href="../lyear/css/style.min.css" th:href="@{/lyear/css/style.min.css}" rel="stylesheet" type="text/css"/>

    <!--    <script th:src="@{/js/jquery_min.js}"></script>-->
    <!--    <script th:src="@{/js/bootstrap.min.js}"></script>-->
    <!--    <script th:src="@{/js/wow.min.js}"></script>-->
    <!--    <script th:src="@{/js/custom.js}"></script>-->
    <!--    <script th:src="@{/plugins/slider-pro/js/jquery.sliderPro.min.js}"></script>-->
    <!--    <script th:src="@{/plugins/owlcarousel/js/owl.carousel.min.js}"></script>-->
    <!--    <script th:src="@{/layer/layer.js}"></script>-->

    <!-- 引入jQuery和bootstrap的js -->
    <script th:src="@{/js2/jquery.js}"></script>
    <script th:src="@{/bootstrap/js/bootstrap.js}"></script>
    <!--滚动条插件-->
    <script th:src="@{/lyear/js/perfect-scrollbar.min.js}"></script>
    <!--弹出框js-->
    <script th:src="@{/lyear/jconfirm/jquery-confirm.min.js}"></script>
    <!--富文本编辑框js-->
    <script th:src="@{/js2/wangEditor.js}"></script>
    <!--自定义js脚本-->
    <script th:src="@{/lyear/js/main.min.js}"></script>
    <script th:src="@{/js2/md5.js}"></script>

    <script th:inline="javascript" type="text/javascript">
        function uploadImage(){
            var file = $("#file")[0].files[0];
            var formData = new FormData();
            formData.append("file", file);
            // $("#imagePosition").attr("src", "/platform/images/" + file.name);
            $("#file").attr("testName", file.name.substring(0, file.name.indexOf(".")));
            console.log($("#file").attr("testName"));
            $.ajax({
                url: '/platform/system/uploadImage',
                type: 'post',
                data: formData,
                processData: false,
                contentType: false,
                cache: false,
                success:function (result){
                    if (result.code === 100) {
                        window.alert("图片提交成功");
                        $("#imagePosition").attr("src", "/platform/images/" + file.name);
                    }else {
                        window.alert("图片提交失败");
                    }
                }
            })
        }

        function uploadUpdateImage(){
            var file = $("#updateFile")[0].files[0];
            var formData = new FormData();
            formData.append("file", file);
            // $("#imagePosition").attr("src", "/platform/images/" + file.name);
            $("#updateFile").attr("testName", file.name.substring(0, file.name.indexOf(".")));
            console.log($("#updateFile").attr("testName"));
            $.ajax({
                url: '/platform/system/uploadImage',
                type: 'post',
                data: formData,
                processData: false,
                contentType: false,
                cache: false,
                success:function (result){
                    if (result.code === 100) {
                        window.alert("图片提交成功");
                        $("#imageUpdatePosition").attr("src", "/platform/images/" + file.name);
                    }else {
                        window.alert("图片提交失败");
                    }
                }
            })
        }
        //点击新增按钮弹出模态框。
        $(document).on("click", "#committee_add_modal_btn", function () {
            //限制富文本编辑器在模态框中的显示
            var E = window.wangEditor;
            var editor = new E('#addDescEditor');
            editor.customConfig.zIndex = 100;
            editor.customConfig.onchange = function(html) {
                // 监控变化，同步更新到 textarea
                //alert(html);
                textArea = html;
                $("#addDescEditor").val(html);
                $("#addCommitteeDesc").val(html);
                //alert($("#divEditor").val());
            }
            editor.create();
            //初始化显示内容
            editor.txt.html("<h1>欢迎编辑，请输入文字...</h1>");
            //清除表单数据（表单完整重置（表单的数据，表单的样式））
            reset_form("#committeeAddModal form");
            //弹出模态框
            $("#committeeAddModal").modal({
                //点击增加框背景不删除增加框
                backdrop: "static"
            });
        });

        //点击保存，保存新增党务管理成员信息。
        function addCommittee(){
            //清空表单样式
            console.log("保存党务管理成员信息");
            clean_form("#committeeAddModal form");
            var name = $("#name_add_input").val();

            var unit = $("#unit_add_select").val();
            var position = $("#position_add_input").val();
            var telephone = $("#telephone_add_input").val();
            var work = $("#work_add_input").val();
            var introduction = $("#addCommitteeDesc").val();
            var image = $("#file").attr("testName");


            if (name.length === 0) {
                show_validate_msg("#name_add_input",
                    "error", "姓名不能为空");
                return false;
            }
            if (unit.length === 0) {
                show_validate_msg("#unit_add_input",
                    "error", "单位不能为空");
                return false;
            }
            if (position.length === 0) {
                show_validate_msg("#position_add_input",
                    "error", "职位不能为空");
                return false;
            }
            if (work.length === 0) {
                show_validate_msg("#work_add_input",
                    "error", "工作内容不能为空");
                return false;
            }
            //2、发送ajax请求保存用户
            $.ajax({
                url: "/platform/system/party/addPartyCommittee",
                type: "POST",
                data:{
                    "name":name,
                    "sex":$("#committeeAddModal input:radio:checked").val(),
                    "unit":unit,
                    "position":position,
                    "telephone":telephone,
                    "work":work,
                    "introduction":introduction,
                    "image":image
                },
                success: function (result) {
                    if (result.code === 100) {
                        $("#committeeAddModal").modal('hide');
                        window.alert('党务管理成员新增成功！');
                        setTimeout(function () {
                            var pageNum = [[${page.number}]]+1;
                            var pageSize = [[${page.size}]];
                            location.href = "/platform/system/party/toPartyCommitteeListUI?pageNum=" + pageNum + "&pageSize=" + pageSize;
                        }, 1000);
                    } else {
                        window.alert('党务管理成员新增失败！');
                    }
                }
            });
        }

        //点击编辑按钮时触发事件
        $(document).on("click", ".update_btn", function () {
            //根据用户id发送ajax请求，查出用户信息并显示
            getCommitteeInfo($(this).attr("update-id"));
            // console.log($(this).attr("update-id"));
            //把用户的id传递给模态框的更新按钮
            $("#committee_update_btn").attr("update-id", $(this).attr("update-id"));
            // console.log($("#user_update_btn").attr("update-id"));
            $("#committeeUpdateModal").modal({
                backdrop: "static"
            });
        });

        //根据id查出用户信息并显示
        function getCommitteeInfo(id) {
            $.ajax({
                url: "/platform/system/party/getCommitteeById?id=" + id,
                type: "GET",
                success: function (result) {
                    var villageCommittee = result.extend.villageCommittee;

                    //显示数据之前先清除一下校验样式，如果有的话
                    reset_form("#committeeUpdateModal form");

                    $("#name_update_input").val(villageCommittee.name);
                    $("#committeeUpdateModal input[name=type]").val([villageCommittee.sex]);
                    $("#unit_update_select").val(villageCommittee.unit);
                    $("#position_update_input").val(villageCommittee.position);
                    $("#telephone_update_input").val(villageCommittee.telephone);
                    $("#work_update_input").val(villageCommittee.work);
                    if (null != villageCommittee.image&& villageCommittee.image != ""){
                        $("#imageUpdatePosition").attr("src", "/platform/images/" + villageCommittee.image + ".jpg");
                        $("#updateFile").attr("testName", villageCommittee.image);
                    }

                    //初始化富文本编辑框
                    var E2 = window.wangEditor;
                    var editor2 = new E2('#updateDescEditor');
                    editor2.customConfig.zIndex = 100;
                    editor2.customConfig.onchange = function(html) {
                        // 监控变化，同步更新到 textarea
                        //alert(html);
                        textArea = html;
                        $("#updateDescEditor").val(html);
                        $("#updateCommitteeDesc").val(html);
                        //alert($("#divEditor").val());
                    };
                    editor2.create();
                    editor2.txt.html(villageCommittee.introduction);
                    $("#updateCommitteeDesc").val(editor2.txt.html());
                    // console.log(editor2.txt.html());

                }
            });
        }

        //点击更新，更新党务管理成员信息
        function updateCommittee(){
            //清空表单样式
            console.log("点击更新");
            clean_form("#committeeUpdateModal form");
            var name = $("#name_update_input").val();

            var unit = $("#unit_update_select").val();
            var position = $("#position_update_input").val();
            var telephone = $("#telephone_update_input").val();
            var work = $("#work_update_input").val();
            var introduction = $("#updateCommitteeDesc").val();
            var image = $("#updateFile").attr("testName");

            if (name.length === 0) {
                show_validate_msg("#name_update_input",
                    "error", "姓名不能为空");
                return false;
            }
            if (unit.length === 0) {
                show_validate_msg("#unit_update_select",
                    "error", "单位不能为空");
                return false;
            }
            if (position.length === 0) {
                show_validate_msg("#position_update_input",
                    "error", "职位不能为空");
                return false;
            }
            if (work.length === 0) {
                show_validate_msg("#work_update_input",
                    "error", "工作内容不能为空");
                return false;
            }
            //2、发送ajax请求保存更新的员工数据
            $.ajax({
                url: "/platform/system/party/updateCommittee?id=" + $("#committee_update_btn").attr("update-id"),
                type: "PUT",
                // data: $("#userUpdateModal form").serialize(),
                data:{
                    "name":name,
                    "sex":$("#committeeUpdateModal input:radio:checked").val(),
                    "unit":unit,
                    "position":position,
                    "telephone":telephone,
                    "work":work,
                    "introduction":introduction,
                    "image":image
                },
                success: function (result) {
                    if (result.code === 100) {
                        $("#committeeUpdateModal").modal('hide');
                        window.alert('党务管理成员信息修改成功！');
                        setTimeout(function () {
                            var pageNum = [[${page.number}]] +1;
                            var pageSize = [[${page.size}]];
                            location.href = "/platform/system/party/toPartyCommitteeListUI?pageNum=" + pageNum + "&pageSize=" + pageSize;
                        }, 1000);
                    } else {
                        window.alert('党务管理成员信息修改失败！');
                    }
                }
            });
        }

        //单个删除
        $(document).on("click", ".delete_btn", function () {
            //1、弹出是否确认删除对话框
            var id = $(this).attr("delete-id");
            var committee = $(this).attr("delete-name");
            var message = window.confirm("确定删除党务管理成员" + committee + "吗？");

            if (message == true){
                confirmDelete(id);
            }else {
                window.alert('已取消!');
            }
        });

        //确认删除后的行为
        function confirmDelete(id){
            $.ajax({
                url: "/platform/system/party/deleteCommitteeById?id=" + id,
                type: "DELETE",
                success: function (result) {
                    if (result.code === 100) {
                        window.alert('删除该党务管理成员信息成功！');
                        setTimeout(function () {
                            var pageNum = [[${page.number}]] + 1;
                            var pageSize = [[${page.size}]];
                            location.href = "/platform/system/party/toPartyCommitteeListUI?pageNum=" + pageNum  + "&pageSize=" + pageSize;

                        }, 1000);
                    } else {
                        window.alert('删除该党务管理成员信息失败!');
                    }
                }
            });
        }


        //清空表单样式及内容
        function reset_form(ele) {
            $(ele)[0].reset();
            //清空表单样式
            $(ele).find("*").removeClass("has-error has-success");
            $(ele).find(".help-block").text("");
        }

        //清空表单样式
        function clean_form(ele) {
            //清空表单样式
            $(ele).find("*").removeClass("has-error has-success");
            $(ele).find(".help-block").text("");
        }
        //显示校验结果的提示信息
        function show_validate_msg(ele, status, msg) {
            //清除当前元素的校验状态
            $(ele).parent().removeClass("has-success has-error");
            $(ele).next("span").text("");
            if ("success" === status) {
                $(ele).parent().addClass("has-success");
                $(ele).next("span").text(msg);
            } else if ("error" === status) {
                $(ele).parent().addClass("has-error");
                $(ele).next("span").text(msg);
            }
        }
    </script>
</head>
<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container" layout:fragment="content">
        <!--页面主要内容-->
        <main class="lyear-layout-content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-header">
                                <h4>党务管理</h4>
                                <li class="pull-right">
                                    <div class="search-tags">
                                        <form th:action="@{/system/party/toPartyCommitteeListUI}" methed="post" name="search-form"  id="search-form" class="form-inline">
                                            <div class="input-group">
                                                <input type="text" name="searchName" th:value="${searchName}" class="form-control">
                                                <span class="input-group-btn">
                                                <input class="btn btn-info" type="submit" value="名称搜索" style="background-color: #33cabb;border-color: #33cabb;"><i class="fa fa-search"></i>  </input>
                                            </span>
                                            </div>
                                        </form>
                                    </div>
                                </li>
                            </div>
                            <div class="card-body">
                                <div class="table-responsive">
                                    <table class="table table-hover table-striped">
                                        <thead>
                                        <tr>
                                            <th class="info">姓名</th>
                                            <th class="info">性别</th>
                                            <th class="info">单位</th>
                                            <th class="info">职位</th>
                                            <th class="info">工作内容</th>
                                            <th class="info">个人介绍</th>
                                            <th class="info">相关操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr th:each="committee:${page.content}">
                                            <!--                                            <td th:text="${activities.image}"></td>-->
<!--                                            <td>-->
<!--                                                <img th:src="@{'/images/' + ${activities.image}+'.jpg'}" alt="" style="width: 80px; height: auto">-->
<!--                                            </td>-->
                                            <td th:text="${committee.name}"></td>
                                            <td th:text="${committee.sex}"></td>
                                            <td th:text="${committee.unit}"></td>
                                            <td th:text="${committee.position}"></td>
<!--                                            <td th:text="${committee.work}"></td>-->
<!--                                            <td th:text="${committee.introduction}"></td>-->
                                            <td th:text="${#strings.length(committee.work)>=10?#strings.substring(committee.work,0,10)+'...':committee.work}"></td>
                                            <td th:utext="${#strings.length(committee.introduction)>=10?#strings.substring(committee.introduction,0,10)+'...':committee.introduction}"></td>
                                            <td>
                                                <button class="btn btn-primary btn-sm update_btn"
                                                        th:attr="update-id=${committee.id}">
															<span class="glyphicon glyphicon-pencil"
                                                                  aria-hidden="true"></span> 编辑
                                                </button>
                                                <button class="btn btn-danger btn-sm delete_btn"
                                                        th:attr="delete-id=${committee.id},delete-name=${committee.name}">
															<span class="glyphicon glyphicon-trash"
                                                                  aria-hidden="true"></span> 删除
                                                </button>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                            <!-- 显示分页信息 -->
                            <div class="row">
                                <!-- 新增按钮 -->
                                <div class="col-md-1" style="margin-left: 24px">
                                    <button id="committee_add_modal_btn" class="btn btn-primary">新增</button>
                                </div>

                                <div class="col-md-5">
                                    <div class="btn-group">
                                        <button class="btn btn-default">
                                            <span>页次：</span>
                                        </button>
                                        <button class="btn btn-default">
                                            <span th:text="${page.number}+1+'/'+${page.totalPages}+'页'"></span>
                                        </button>
                                        <button class="btn btn-default">
                                            <span>每页显示：</span>
                                        </button>
                                        <button class="btn btn-default">
                                            <span>5条</span>
                                        </button>
                                        <button class="btn btn-default">
                                            <span>总记录数：</span>
                                        </button>
                                        <button class="btn btn-default">
                                            <span th:text="${page.totalElements}+'条'"></span>
                                        </button>
                                    </div>
                                </div>
                                <!-- 分页条信息 -->
                                <div class="col-md-5">
                                    <nav aria-label="Page navigation">
                                        <ul class="pagination pagination-lg pull-right"
                                            style="margin-top: 0">
                                            <li>
                                                <a th:href="@{/system/party/toPartyCommitteeListUI(pageNum=1,pageSize=${page.size})}">首页</a>
                                            </li>

                                            <li th:if="${page.hasPrevious() }"><a
                                                    th:href="@{/system/party/toPartyCommitteeListUI(pageNum=${page.number},pageSize=${page.size})}"
                                                    aria-label="Previous"> <span aria-hidden="true">&laquo;</span>
                                            </a></li>

                                            <li th:each="page_Num:${#numbers.sequence(1, page.totalPages)}"
                                                th:class="${page_Num == page.number + 1?'active':''}">
                                                <a th:if="${page_Num == page.number + 1}"
                                                   th:text="${page_Num}"
                                                   th:href="@{#}">
                                                </a>
                                                <a th:text="${page_Num}"
                                                   th:if="${page_Num != page.number + 1}"
                                                   th:href="@{/system/party/toPartyCommitteeListUI(pageNum=${page_Num},pageSize=${page.size})}">
                                                </a>
                                            </li>

                                            <li th:if="${page.hasNext() }"><a
                                                    th:href="@{/system/party/toPartyCommitteeListUI(pageNum=${page.number}+2,pageSize=${page.size})}"
                                                    aria-label="Next"> <span aria-hidden="true">&raquo;</span>
                                            </a></li>

                                            <li><a
                                                    th:href="@{/system/party/toPartyCommitteeListUI(pageNum=${page.totalPages},pageSize=${page.size})}">末页</a>
                                            </li>
                                        </ul>
                                    </nav>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- 新增党务管理的模态框 -->
                    <div class="modal fade bs-example-modal-lg" id="committeeAddModal" tabindex="-1"
                         role="dialog" aria-labelledby="myModalLabel">
                        <div class="modal-dialog modal-lg" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal"
                                            aria-label="Close">
                                        <span aria-hidden="true">&times;</span>
                                    </button>
                                    <h4 class="modal-title">新增党务管理成员</h4>
                                </div>
                                <div class="modal-body">
                                    <!--要提交的表单 -->
                                    <form class="form-horizontal" enctype="multipart/form-data" method="post">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">姓名：</label>
                                            <div class="col-sm-6">
                                                <input type="text" class="form-control"
                                                       id="name_add_input" name="name"
                                                       placeholder="请输入姓名：">
                                                <span class="help-block"></span>
                                            </div>
                                            <div class="col-sm-1">
                                                <em style="color: red">*</em>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">性别：</label>
                                            <div class="col-sm-6">
                                                <div class="example-box">
                                                    <label class="lyear-radio radio-inline"> <input
                                                            type="radio" name="type"
                                                            value="男" checked="checked"><span>男</span>
                                                    </label> <label class="lyear-radio radio-inline"> <input
                                                        type="radio" name="type"
                                                        value="女"> <span>女</span>
                                                </label>
                                                </div>
                                            </div>
                                            <div class="col-sm-1">
                                                <em style="color: red">*</em>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">单位：</label>
                                            <div class="col-sm-6">
                                                <select class="form-control" name="unit" id="unit_add_select">
                                                    <option value="">请选择</option>
                                                    <option th:each="unit:${unitList}"
                                                            th:value="${unit}"
                                                            th:text="${unit}"></option>
                                                </select>
                                            </div>
                                            <div class="col-sm-1">
                                                <em style="color: red">*</em>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">职位：</label>
                                            <div class="col-sm-6">
                                                <input type="text" class="form-control"
                                                       id="position_add_input" name="position"
                                                       placeholder="请输入职位：">
                                                <span class="help-block"></span>
                                            </div>
                                            <div class="col-sm-1">
                                                <em style="color: red">*</em>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">联系方式：</label>
                                            <div class="col-sm-6">
                                                <input type="text" class="form-control"
                                                       id="telephone_add_input" name="telephone"
                                                       placeholder="请输入联系方式：">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">工作内容：</label>
                                            <div class="col-sm-6">
                                                <input type="text" class="form-control"
                                                       id="work_add_input" name="work"
                                                       placeholder="请输入工作内容：">
                                                <span class="help-block"></span>
                                            </div>
                                            <div class="col-sm-1">
                                                <em style="color: red">*</em>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">个人介绍：</label>
                                            <div class="col-sm-10">
                                                <div id="addDescEditor"></div>
                                                <input type="text" name="committeeDesc" id="addCommitteeDesc"
                                                       style="display: none" />
                                            </div>
                                        </div>
                                        <div id="imageDiv" class="form-group m-b-10" style="text-align:right">
                                            <label class="col-sm-2 control-label">
                                                上传图片:
                                            </label>
                                            <div class="col-sm-6">
                                                <input type="file" id="file" name="file" onchange="uploadImage()" th:attr="testName='example'">
                                                <img id="imagePosition" style="width: 100px !important; display: inherit">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>

                                    </form>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default"
                                            data-dismiss="modal">关闭
                                    </button>
                                    <button type="button" class="btn btn-primary"
                                            id="committee_save_btn" onclick="addCommittee()">保存
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!--修改党务管理成员的模态框 -->
                    <div class="modal fade" id="committeeUpdateModal" tabindex="-1"
                         role="dialog" aria-labelledby="myModalLabel">
                        <div class="modal-dialog modal-lg" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal"
                                            aria-label="Close">
                                        <span aria-hidden="true">&times;</span>
                                    </button>
                                    <h4 class="modal-title">修改党务管理成员信息</h4>
                                </div>
                                <div class="modal-body">
                                    <!--要提交的表单 -->
                                    <form class="form-horizontal" id="form-submit" enctype="multipart/form-data" method="post">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">姓名：</label>
                                            <div class="col-sm-6">
                                                <input type="text" class="form-control"
                                                       id="name_update_input" name="name"
                                                       placeholder="请输入姓名：">
                                                <span class="help-block"></span>
                                            </div>
                                            <div class="col-sm-1">
                                                <em style="color: red">*</em>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">性别：</label>
                                            <div class="col-sm-6">
                                                <div class="example-box">
                                                    <label class="lyear-radio radio-inline"> <input
                                                            type="radio" name="type"
                                                            value="男" checked="checked"><span>男</span>
                                                    </label> <label class="lyear-radio radio-inline"> <input
                                                        type="radio" name="type"
                                                        value="女"> <span>女</span>
                                                </label>
                                                </div>
                                            </div>
                                            <div class="col-sm-1">
                                                <em style="color: red">*</em>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">单位：</label>
                                            <div class="col-sm-6">
                                                <select class="form-control" name="unit" id="unit_update_select">
                                                    <option value="">请选择</option>
                                                    <option th:each="unit:${unitList}"
                                                            th:value="${unit}"
                                                            th:text="${unit}"></option>
                                                </select>
                                            </div>
                                            <div class="col-sm-1">
                                                <em style="color: red">*</em>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">职位：</label>
                                            <div class="col-sm-6">
                                                <input type="text" class="form-control"
                                                       id="position_update_input" name="position"
                                                       placeholder="请输入职位：">
                                                <span class="help-block"></span>
                                            </div>
                                            <div class="col-sm-1">
                                                <em style="color: red">*</em>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">联系方式：</label>
                                            <div class="col-sm-6">
                                                <input type="text" class="form-control"
                                                       id="telephone_update_input" name="telephone"
                                                       placeholder="请输入联系方式：">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">工作内容：</label>
                                            <div class="col-sm-6">
                                                <input type="text" class="form-control"
                                                       id="work_update_input" name="work"
                                                       placeholder="请输入工作内容：">
                                                <span class="help-block"></span>
                                            </div>
                                            <div class="col-sm-1">
                                                <em style="color: red">*</em>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">个人介绍：</label>
                                            <div class="col-sm-10">
                                                <div id="updateDescEditor"></div>
                                                <input type="text" name="committeeDesc" id="updateCommitteeDesc"
                                                       style="display: none" />
                                            </div>
                                        </div>
                                        <div id="imageUpdateDiv" class="form-group m-b-10" style="text-align:right">
                                            <label class="col-sm-2 control-label">
                                                上传图片:
                                            </label>
                                            <div class="col-sm-6">
                                                <input type="file" id="updateFile" name="updateFile" onchange="uploadUpdateImage()" th:attr="testName='example'">
                                                <img id="imageUpdatePosition" style="width: 100px !important; display: inherit">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>

                                    </form>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default"
                                            data-dismiss="modal">关闭
                                    </button>
                                    <button type="button" class="btn btn-primary"  th:attr="update-id=0"
                                            id="committee_update_btn" onclick="updateCommittee()">更新
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </main>
    </div>
</div>

</body>
</html>